package com.ruyuan.seckilling.activity.request;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

/**
 * @author zhonghuashishan
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ActivityQueryPageRequest {

    private String activityName;

    private String minStartTime;

    private String maxStartTime;

    private Integer status;

    private Integer pageNum;

    private Integer pageSize;

    public String validateParams() {
        if (Objects.isNull(pageNum) || pageNum <= 0 || Objects.isNull(pageSize) || pageSize <= 0) {
            return "分页参数不合法";
        }
        return null;
    }

}
